package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "pos_master_shop")
//@NamedQueries({
//    @NamedQuery(name = "PosMasterShot.findAll", query = "SELECT t FROM PosMasterShop t"),
//    @NamedQuery(name = "PosMasterShot.findBySync", query = "SELECT t FROM PosMasterShop t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosMasterShot.findByShopId", query = "SELECT t FROM PosMasterShop t WHERE t.shopId = :shopId"),
//    @NamedQuery(name = "PosMasterShot.findByShopUnitId", query = "SELECT t FROM PosMasterShop t WHERE t.shopUnitId = :shop_unit_id"),
//    @NamedQuery(name = "PosMasterShot.findByShopType", query = "SELECT t FROM PosMasterShop t WHERE t.shopType = :shopType"),
//    @NamedQuery(name = "PosMasterShot.findByShopCode", query = "SELECT t FROM PosMasterShop t WHERE t.shopCode = :shopCode"),
//    @NamedQuery(name = "PosMasterShot.findByShopName", query = "SELECT t FROM PosMasterShop t WHERE t.shopName = :shopName"),
//    @NamedQuery(name = "PosMasterShot.findByShopAddress", query = "SELECT t FROM PosMasterShop t WHERE t.shopAddress = :shopAddress"),
//    @NamedQuery(name = "PosMasterShot.findByShopPhone", query = "SELECT t FROM PosMasterShop t WHERE t.shopPhone = :shopPhone"),
//    @NamedQuery(name = "PosMasterShot.findByShopContact", query = "SELECT t FROM PosMasterShop t WHERE t.shopContact = :shopContact")})
public class PosMasterShop implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "shop_id")
    private Integer shopId;
    @Column(name = "shop_type")
    private String shopType;
    @Column(name = "shop_code")
    private String shopCode;
    @Column(name = "shop_name")
    private String shopName;
    @Column(name = "shop_address")
    private String shopAddress;
    @Column(name = "shop_phone")
    private String shopPhone;
    @Column(name = "shop_contact")
    private String shopContact;
    @JoinColumn(name = "shop_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit shopUnitId;

    public PosMasterShop() {
    }

    public PosMasterShop(Integer shopId) {
        this.shopId = shopId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    public MasterUnit getShopUnitId() {
        return shopUnitId;
    }

    public void setShopUnitId(MasterUnit shopUnitId) {
        this.shopUnitId = shopUnitId;
    }

    public String getShopType() {
        return shopType;
    }

    public void setShopType(String shopType) {
        this.shopType = shopType;
    }

    public String getShopCode() {
        return shopCode;
    }

    public void setShopCode(String shopCode) {
        this.shopCode = shopCode;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public String getShopPhone() {
        return shopPhone;
    }

    public void setShopPhone(String shopPhone) {
        this.shopPhone = shopPhone;
    }

    public String getShopContact() {
        return shopContact;
    }

    public void setShopContact(String shopContact) {
        this.shopContact = shopContact;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shopId != null ? shopId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterShop)) {
            return false;
        }
        PosMasterShop other = (PosMasterShop) object;
        if ((this.shopId == null && other.shopId != null) || (this.shopId != null && !this.shopId.equals(other.shopId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return shopName + " - " + shopAddress;
        //return "com.buanalintas.sandals.pos.entities.PosMasterShop[shopId=" + shopId + "]";
    }
}
